package com.yuran.system.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.yuran.common.annotation.Excel;
import com.yuran.common.annotation.Excel.ColumnType;
import com.yuran.common.core.domain.BaseEntity;

/**
 * 标签表 sys_label
 * 
 * @author yuran
 */
public class SysLabel extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 标签序号 */
    @Excel(name = "标签序号", cellType = ColumnType.NUMERIC)
    private Long labelId;

    /** 标签编码 */
    @Excel(name = "标签编码")
    private String labelCode;

    /** 标签名称 */
    @Excel(name = "标签名称")
    private String labelName;

    /** 标签排序 */
    @Excel(name = "标签排序")
    private Integer labelSort;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 用户是否存在此标签标识 默认不存在 */
    private boolean flag = false;

    public Long getLabelId()
    {
        return labelId;
    }

    public void setLabelId(Long labelId)
    {
        this.labelId = labelId;
    }

    @NotBlank(message = "标签编码不能为空")
    @Size(min = 0, max = 64, message = "标签编码长度不能超过64个字符")
    public String getLabelCode()
    {
        return labelCode;
    }

    public void setLabelCode(String labelCode)
    {
        this.labelCode = labelCode;
    }

    @NotBlank(message = "标签名称不能为空")
    @Size(min = 0, max = 50, message = "标签名称长度不能超过50个字符")
    public String getLabelName()
    {
        return labelName;
    }

    public void setLabelName(String labelName)
    {
        this.labelName = labelName;
    }

    @NotNull(message = "显示顺序不能为空")
    public Integer getLabelSort()
    {
        return labelSort;
    }

    public void setLabelSort(Integer labelSort)
    {
        this.labelSort = labelSort;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public boolean isFlag()
    {
        return flag;
    }

    public void setFlag(boolean flag)
    {
        this.flag = flag;
    }
    
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("labelId", getLabelId())
            .append("labelCode", getLabelCode())
            .append("labelName", getLabelName())
            .append("labelSort", getLabelSort())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
